package cn.hl.sfzy.service.impl;

import cn.hl.sfzy.entity.Course;
import cn.hl.sfzy.entity.CourseType;
import cn.hl.sfzy.entity.UserCourse;
import cn.hl.sfzy.mapper.CourseTypeMapper;
import cn.hl.sfzy.mapper.UserCourseMapper;
import cn.hl.sfzy.service.UserCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName UserCourseServiceImpl
 * @Description TODO
 * @Author libowen
 * @Date 2024年10月30日 16:34
 * @Version 1.0
 */
@Service
public class UserCourseServiceImpl implements UserCourseService {

    @Autowired
    private UserCourseMapper userCourseMapper;

    @Override
    public List<Course> getCourseByUserId(Long user_id) {
        List<Course> select = userCourseMapper.selectByUserId(user_id);
        return select;
    }

    @Override
    public int addUserCourse(UserCourse userCourse) {
        int insert = userCourseMapper.insert(userCourse);
        return insert;
    }

    @Override
    public int getIdByUserAndCourse(UserCourse userCourse) {
        int id = userCourseMapper.selectByUserAndCourse(userCourse);
        return id;
    }

    @Override
    public int delete(int id) {
        int delete = userCourseMapper.delete(id);
        return delete;
    }

    @Override
    public int deleteByUserAndCourse(UserCourse userCourse) {
        int delete = userCourseMapper.deleteByUserAndCourse(userCourse);
        return delete;
    }

    @Override
    public int updatejia(Integer id) {
        int updatejia = userCourseMapper.updatejia(id);
        return updatejia;
    }

    @Override
    public int updatejian(Integer id) {
        int updatejian = userCourseMapper.updatejian(id);
        return updatejian;
    }


}
